﻿<!--#include file="const.inc"-->
<%
'====================================================================
' 感谢使用晴天3G智能建站系统..
' 作者:梁永强.QQ:766750857
' 官方网址:wap.qt3g.com
' 声明:软件版权归作者所有,没有经过作者本人同意不得非法破解和传播本程序
'====================================================================
%>

<%	dim remark,id,user,uid,reptime,rs,sql


	remark=qingtian.repsql(Request.form("remark"))


	id=trim(Request("id"))
	if id="" then id=0
	if not isnumeric(id) then id=0
	id=clng(id)

	Set Rs = Server.CreateObject("Adodb.Recordset")
	Sql = "select [reptime] from qingtian_viewli where id="&id
	Rs.Open Sql,conn,1,1
	if not (rs.bof and rs.eof)  then
		reptime=rs("reptime")
	end  if
	Rs.close
	set rs=nothing



	if sid="Null" then
		user="游客"
		uid=0
	else
		uid=qingtian.nid
		user=Replace(qingtian.name(uid),"'", "''")
	end if
select case v
case "0"
we0="<br/>"
%>
<card title="发表评论"  ontimer="articview.asp?id=<%=id%>&amp;sid=<%=sidd%>"><timer value='10'/><p align="<%=qingtian.px%>">
<%
case "1"
zi="<span style=""color:#FF5500"">"
we="<div class=""footer"">"
sou="<div class=""block4"">"
dao="<div class=""navi"">"
we0="</div>"
%>
<title>发表评论</title>
</head>
<body>
<!--#include virtual="/css.inc"-->
<%

End Select

%>

		<%
		if remark="" then
			%><%=we%>评论内容不能为空!<%=we0%><%
		elseif session("comment")=remark then
			%><%=we%>请不要重复发表评论!<%=we0%><%
		else
			%><%=we%>发表评论成功!<%=we0%><%
			session("comment")=remark
		conn.execute("insert into qingtian_view_reply ([listid],[content],[user],[uid])  values ("&id&",'"&remark&"','"&user&"',"&uid&")")
		conn.execute("update qingtian_viewli set RepCount=RepCount+1,[reptime]='" & Now() & "' where id="&id&"")

            	If DateDiff("m", reptime, Now()) > 0 Then
               		conn.execute("update qingtian_viewli set [Monthrep]=1 where [id]=" & id & "")
            	Else
                	conn.execute("update qingtian_viewli set [Monthrep]=[Monthrep]+1 where [id]=" & id & "")
            	End If

            	If DateDiff("ww", reptime, Now()) > 0 Then
                	conn.execute("update qingtian_viewli set [Weekrep]=1 where [id]=" & id & "")
            	Else
            	    conn.execute("update qingtian_viewli set [Weekrep]=[Weekrep]+1 where [id]=" & id & "")
            	End If

            	If DateDiff("d", reptime, Now()) > 0 Then
            	    conn.execute("update qingtian_viewli set [Dayrep]=1 where [id]=" & id & "")
            	Else
            	    conn.execute("update qingtian_viewli set [Dayrep]=[Dayrep]+1 where [id]=" & id & "")
           	 End If

		end if

		 %><%=dao%>---------------<%=we0%><%=we%><a href="articview.asp?id=<%=id%>&amp;sid=<%=sidd%>">返回文章页</a><%=we0%>

<%
end Function
%>
